import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "shareLinks",
    meta: { isRequest: true },
    component: () => import("../view/shareLinks/shareLinks")
  },
  {
    path: "/jurisdiction/manual",
    name: "jurisdictionManual",
    meta: { 
      isRequest: true,
      title: '共享/部门空间权限说明',
      requireAuth: true 
    },
    component: () => import("../view/jurisdiction/manual")
  },
  {
    path: "/tools/richEiditor",
    meta: { isRequest: true },
    component: () => import("../view/tools/richEiditor")
  },
  {
    path: "/duty/details",
    name: "dutyDetails",
    meta: { isRequest: true },
    component: () => import("../view/duty/details")
  },
  {
    path: "/notice/details",
    name: "noticeDetails",
    meta: { isRequest: true },
    component: () => import("../view/notice/details")
  },
  {
    path: "/noticeOperation/more",
    name: "noticeOperation",
    meta: { isRequest: true },
    component: () => import("../view/noticeOperation/more")
  },
  // {
  //   path: "/addFriends/addFriends",
  //   name: "addFriends",
  //   meta: { isRequest: true },
  //   component: () => import("../view/addFriends/addFriends")
  // },
  {
    path: "/institution/details",
    name: "institutionDetails",
    meta: { isRequest: true },
    component: () => import("../view/institution/details")
  }
];
const router = new VueRouter({
  routes
});
// router.beforeEach((to, from, next) => {
//   if (store.state.common.selfInfo.token === "") {
//     console.log("1", store.state.common);
//     window.Client.getUserInfo(res => {
//       console.log("11111", res);
//       store.commit("setUserInfo", res);
//       // next();
//     });
//   } else {
//     next();
//   }
// });
export default router;
